Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: add cli option to exclude env vars on dr #55697

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

RafaelGSS
Copy link
Member

@RafaelGSS RafaelGSS commented Nov 2, 2024

This PR introduces a new cli flag --report-exclude-env to avoid writing env vars on diagnostic reports.

Some context: https://x.com/arthurfiorette/status/1848372069198614664

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Nov 2, 2024
lib/internal/process/report.js Outdated Show resolved Hide resolved
src/node_report_module.cc Outdated Show resolved Hide resolved
@RafaelGSS RafaelGSS added the semver-minor PRs that contain new features and should be released in the next minor version. label Nov 2, 2024
@richardlau
Copy link
Member

For consistency with --report-exclude-network I'd prefer if this was --report-exclude-env.

@RedYetiDev RedYetiDev added the report Issues and PRs related to process.report. label Nov 3, 2024
@RafaelGSS
Copy link
Member Author

PTAL @richardlau @anonrig

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 88.70968% with 7 lines in your changes missing coverage. Please review.

Project coverage is 88.40%. Comparing base (5ce3d10) to head (fed0381).
Report is 68 commits behind head on main.

Files with missing lines Patch % Lines
src/node_report_module.cc 61.53% 5 Missing ⚠️
lib/internal/process/report.js 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55697      +/-   ##
==========================================
- Coverage   88.44%   88.40%   -0.05%     
==========================================
  Files         654      654              
  Lines      187720   187808      +88     
  Branches    36143    36139       -4     
==========================================
+ Hits       166022   166023       +1     
- Misses      14941    15020      +79     
- Partials     6757     6765       +8     
Files with missing lines Coverage Δ
src/env-inl.h 97.06% <100.00%> (+0.22%) ⬆️
src/env.h 98.14% <ø> (ø)
src/node_options.cc 87.46% <100.00%> (+0.01%) ⬆️
src/node_options.h 98.27% <100.00%> (+<0.01%) ⬆️
src/node_report.cc 93.52% <100.00%> (+0.36%) ⬆️
lib/internal/process/report.js 98.57% <71.42%> (-1.43%) ⬇️
src/node_report_module.cc 90.00% <61.53%> (-2.22%) ⬇️

... and 56 files with indirect coverage changes

}

{
const error = new Error();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can you add a // Test with... type comment to this block as well?

Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the PR title could be updated since the flag is renamed as "exclude" rather than "preserve".

@@ -105,6 +107,12 @@ const report = {

nr.setReportOnUncaughtException(trigger);
},
get excludeEnv() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding a setter like set reportOnSignal as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done
fed0381

@RafaelGSS RafaelGSS changed the title src: add cli option to preserve env vars on dr src: add cli option to exlcude env vars on dr Nov 6, 2024
@RafaelGSS RafaelGSS changed the title src: add cli option to exlcude env vars on dr src: add cli option to exclude env vars on dr Nov 6, 2024
@RafaelGSS RafaelGSS added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 7, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 7, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

doc/api/cli.md Show resolved Hide resolved
@RafaelGSS RafaelGSS added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 8, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 8, 2024
@nodejs-github-bot nodejs-github-bot merged commit a243225 into nodejs:main Nov 8, 2024
59 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in a243225

aduh95 pushed a commit that referenced this pull request Nov 16, 2024
PR-URL: #55697
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
RafaelGSS pushed a commit that referenced this pull request Nov 19, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) #55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) #55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) #55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) #55626

PR-URL: TODO
RafaelGSS pushed a commit that referenced this pull request Nov 19, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) #55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) #55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) #55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) #55626

PR-URL: #55921
RafaelGSS added a commit that referenced this pull request Nov 19, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) #55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) #55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) #55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) #55626

PR-URL: #55921
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: nodejs#1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: nodejs#1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: nodejs#1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: nodejs#1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: nodejs#1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: https://github.com/nodejs/aduh95/pull/1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
RafaelGSS added a commit that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) #55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) #55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) #55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) #55626

PR-URL: #55921
tpoisseau pushed a commit to tpoisseau/node that referenced this pull request Nov 21, 2024
PR-URL: nodejs#55697
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
tpoisseau pushed a commit to tpoisseau/node that referenced this pull request Nov 21, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: nodejs#55921
@Tofandel
Copy link
Contributor

Tofandel commented Nov 21, 2024

Interestingly the changelog entry and commit message does not match the PR title
ccb69bb8d5
nodejs/nodejs.org@881afd4#diff-51e790f0f935b3734f4f20688ad920248a1412cabced30879384e74186e4480fR14

@richardlau
Copy link
Member

Interestingly the changelog entry and commit message does not match the PR title ccb69bb8d5 nodejs/nodejs.org@881afd4#diff-51e790f0f935b3734f4f20688ad920248a1412cabced30879384e74186e4480fR14

That was due to the discussion in #55921 (comment).

@Tofandel
Copy link
Contributor

Tofandel commented Nov 21, 2024

No no, I mean in both the commit message and changelog they have "to preserve env" instead of "to exclude env" which is the old PR title

github-actions bot pushed a commit to RafaelGSS/node that referenced this pull request Nov 22, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
sqlite:
  * (SEMVER-MINOR) add support for SQLite Session Extension (Bart Louwers) nodejs#54181
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: TODO
github-actions bot pushed a commit to RafaelGSS/node that referenced this pull request Nov 22, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
sqlite:
  * (SEMVER-MINOR) add support for SQLite Session Extension (Bart Louwers) nodejs#54181
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: TODO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. report Issues and PRs related to process.report. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants